//jquery extend
(function(jQuery) {
	jQuery.extend(jQuery.fn, {
		outer : function() {
			return jQuery(jQuery("<div></div>").html(this.clone())).html();
		}
	});
	jQuery
			.extend({
				// 弹出浮层
				popMsg : function(m, title, width, height) {
					var t = title || "标题";
					var w = width || 400;
					var h = height || 300;
					h = parseInt(h) + 15;//算上标题
					var str = '<h2><strong>'
							+ title
							+ '</strong><a title="关闭" class="close" href="javascript:void(0);" onclick="jQuery.unblockUI();"></a></h2>';
					var mes = jQuery('<div class="common-mod"></div>').html(
							str + jQuery(m).clone().css("display", "").outer());
					var left = 0;
					var top = 0;
					if (jQuery.browser.msie) {
						/*
						 * for ie
						 */
						left = (document.body.clientWidth - w) / 2;
						top = (document.documentElement.clientHeight - h) / 2
								+ document.body.scrollTop;
						// alert(left + ':' + top);
					} else {
						/*
						 * for firefox
						 */
						left = (window.innerWidth - w) / 2 + window.pageXOffset;
						top = (window.innerHeight - h) / 2;
					}
					jQuery.blockUI({
						message : mes,
						css : {
							left : left + 'px',
							top : top + 'px',
							width : w + 'px',
							height : h + 'px',
							cursor : 'hand'
						},
						overlayCSS : {
							cursor : 'default'
						}
					});
					// jQuery('.blockOverlay').append('<img
					// id="buttonCloseBlockUI" src="' + page.basePath +
					// 'images/buttonCLOSE.gif" alt="close"
					// onclick="jQuery.unblockUI()" style="float:right;margin:30
					// 10 0 0;cursor:hand;">');

					jQuery('.blockOverlay').attr('title', '点击这里取消').click(
							jQuery.unblockUI);
				}
			});
})(jQuery);